package com.wedo.mall.activity.main;

import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.e.library.activity.EActivity;
import com.wedo.mall.R;
import com.wedo.mall.adapter.CategoryAdapter;
import com.wedo.mall.entity.Category;

import butterknife.BindView;

/**
 * Created by lxy on 2017/6/19.
 */

public class CategoryActivity extends EActivity {

    @BindView(R.id.rv_category) RecyclerView rv_category;

    @Override
    protected int layout() {
        return R.layout.activity_category;
    }

    @Override
    protected void onActivityCreated(Bundle state) {
        rv_category.setHasFixedSize(true);
        rv_category.setNestedScrollingEnabled(false);
        rv_category.setLayoutManager(new GridLayoutManager(this,4));
        rv_category.setAdapter(new CategoryAdapter(this, Category.categories()));
    }
}
